package chan.project.service;

import chan.project.model.dto.travelPlan.TravelGuide;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import chan.project.model.dto.travelPlan.TravelPlanQueryRequest;
import chan.project.model.entity.TravelPlan;
import chan.project.model.vo.TravelPlanVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 旅行计划服务
 *
 * @author <a href="https://github.com/kavansp">kavansp</a>
 * 
 */
public interface TravelPlanService extends IService<TravelPlan> {

    /**
     * 校验数据
     *
     * @param travelPlan
     * @param add 对创建的数据进行校验
     */
    void validTravelPlan(TravelPlan travelPlan, boolean add);

    /**
     * 获取查询条件
     *
     * @param travelPlanQueryRequest
     * @return
     */
    QueryWrapper<TravelPlan> getQueryWrapper(TravelPlanQueryRequest travelPlanQueryRequest);
    
    /**
     * 获取旅行计划封装
     *
     * @param travelPlan
     * @param request
     * @return
     */
    TravelPlanVO getTravelPlanVO(TravelPlan travelPlan, HttpServletRequest request);

    /**
     * 分页获取旅行计划封装
     *
     * @param travelPlanPage
     * @param request
     * @return
     */
    Page<TravelPlanVO> getTravelPlanVOPage(Page<TravelPlan> travelPlanPage, HttpServletRequest request);

    /**
     * 生成旅行计划
     * @param travelGuide
     * @return
     */
    TravelPlan generateTravelPlan(TravelGuide travelGuide);
}
